-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Typst Language Support #302
base: master
Are you sure you want to change the base?
Conversation
9a7ae81
to
6b5d78a
Compare
…of an environment's span
… possessives or conjunctions
…ove dict parsing to fit better
…ntent in span so quotes aren't escaped
6b5d78a
to
550cf20
Compare
Mostly just needs more tests. I'm no expert in Typst syntax, so if someone wants to help it would be much appreciated. |
If I can understand the core concepts mentioned above (what should/could be checked), then I maybe be able to add some tests. |
- Only consolidate adjacent space spans - Typst spaces distinguish between newlines and spaces - Typst spaces count number of spaces - Spans command now defaults to not show newlines
- Remove unneeded &mut impl Parser in document
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, but I have some questions.
harper-core/Cargo.toml
Outdated
@@ -24,6 +24,7 @@ thiserror = "2.0.9" | |||
unicode-blocks = "0.1.9" | |||
unicode-width = "0.2.0" | |||
levenshtein_automata = { version = "0.2.1", features = ["fst_automaton"] } | |||
typst-syntax = "0.12.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typst is pretty big and completely unused for certain applications (i.e. Obsidian). Would you mind putting Typst support behind a feature flag?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alternatively, you could make the Typst parser its own crate.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How would making it a seperate crate help? It would still be a dependency...
I feel like feature flag is the way to go. I assume we would have it enabled for harper-ls and harper-cli?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are a couple reasons.
The intention is eventually, and especially with harper-tree-sitter
, that Parsers
may become a community endeavor. They should be able to be built without great understanding of Harper internals. Such parsers should be able to stand on their own without official support from me or Automattic.
If people build applications (other than harper-ls
) using Harper, they should be able to build and pull in third-party parsers as they need. Having many parsers in harper-core
sets the expectation that all parsers must be officially supported and maintained by us.
Eventually, I hope this to be true for Linter
s as well, but that's a little ways off.
In fact, if you wish to move the Typst Parser
to its own repository and make this PR simply import it, I find that most appealing.
739ccc2
to
5f83275
Compare
I decided to move typst parsing into its own crate, since it simplifies the feature dependency and establishes good precident that can be followed for unofficial/external parsers in the future. |
Re-opening of #289 from my fork instead of a branch